package info;

import java.util.List;


/**
 * The Review is an immutable object that holds the data for the review submission
 * forms after one has been filled out by a Reviewer.
 * 
 * @author Aaron Chen
 * @version 3/8/2014
 */
public class Review {
  
  /** The index in which the reviewer name will be found in the input list. */
  public static final int FIELDS_REVIEWER_INDEX = 0;
  
  /** The index in which the conference will be found in the input list. */
  public static final int FIELDS_CONFERENCE_INDEX = 1;
  
  /** The index in which the manuscript author will be found in the input list. */
  public static final int FIELDS_AUTHOR_INDEX = 2;
  
  /** The index in which the manuscript title will be found in the input list. */
  public static final int FIELDS_TITLE_INDEX = 3;
  
  
  /** The identification number of the review. */
  private long my_id;

  /** The name of the reviewer that completed the review submission form. */
  private String my_reviewer_name;
  
  /** The ID of the reviewer that completed the review submission form. */
  private long my_reviewer_id;

  /** The conference that the reviewed manuscript was submitted to. */
  private long my_conference_id;

  /** The author of the manuscript that was reviewed. */
  private String my_manuscript_author;

  /** The title of the manuscript that was reviewed. */
  private String my_manuscript_title;

  /** The confidential comments that only the Subprogram Chair will see. */
  private String my_confidential_comments;

  /** The ratings from 1 to 5 for each comment to the author. */
  private int[] my_questionaire_ratings;

  /** The rating from 1 to 5 for the overall quality of the manuscript. */
  private int my_summary_rating;

  /** The rating comments. */
  private String my_summary;
  
  
  /**
   * Constructs a new Review immutable object.
   * @param the_id                    The identification number for this Review.
   * @param the_fields                The answers supplied in the single-line fields.
   * @param the_confidential_comments The confidential comments.
   * @param the_questionaire_ratings  The ratings given for various categories.
   * @param the_summary_rating        The overall quality rating for the manuscript.
   * @param the_summary               The summary comments for the overall quality.
   */
  public Review(final long the_id,
                final List<String> the_fields,
                final String the_confidential_comments,
                final int[] the_questionaire_ratings,
                final int the_summary_rating,
                final String the_summary) {
    my_id = the_id;
    my_reviewer_name = the_fields.get(FIELDS_REVIEWER_INDEX);
    my_conference_id = Long.parseLong(the_fields.get(FIELDS_CONFERENCE_INDEX));
    my_manuscript_author = the_fields.get(FIELDS_AUTHOR_INDEX);
    my_manuscript_title = the_fields.get(FIELDS_TITLE_INDEX);
    my_confidential_comments = the_confidential_comments;
    my_questionaire_ratings = the_questionaire_ratings;
    my_summary_rating = the_summary_rating;
    my_summary = the_summary;
  }
  
  /**
   * Returns the ID of the Review.
   * @return The ID.
   */
  public long getID() {
    return my_id;
  }
  /**
   * Sets the ID of the review.
   * @param the_id The ID.
   */
  public void setID(final long the_id) {
    my_id = the_id;
  }
  /**
   * Returns the name of the Reviewer that completed the review form.
   * @return The Reviewer's name.
   */
  public String getReviewerName() {
    return my_reviewer_name;
  }
  /**
   * Returns the ID of the Reviewer that completed the review form.
   * @return The Reviewer's ID.
   */
  public long getReviewerID() {
    return my_reviewer_id;
  }
  /**
   * Returns the conference that the reviewed manuscript was submitted to.
   * @return The conference.
   */
  public long getConferenceID() {
    return my_conference_id;
  }
  /**
   * Returns the reviewed manuscript's author.
   * @return The author of the manuscript.
   */
  public String getManuscriptAuthor() {
    return my_manuscript_author;
  }
  /**
   * Returns the reviewed manuscript's title.
   * @return The title of the manuscript.
   */
  public String getManuscriptTitle() {
    return my_manuscript_title;
  }
  /**
   * Returns the confidential comments for the Subprogram Chair.
   * @return The confidential comments.
   */
  public String getConfidentialComments() {
    return my_confidential_comments;
  }
  /**
   * Returns the answers given to the questionaire that gives the author feedback to
   * various categories.
   * @return Ratings from 1 to 5 for each review category.
   */
  public int[] getQuestionaireRatings() {
    return my_questionaire_ratings;
  }
  /**
   * Returns a rating from 1 to 5 representing the overall quality of the manuscript.
   * @return A rating from 1 to 5 representing the overall quality of the manuscript.
   */
  public int getSummaryRating() {
    return my_summary_rating;
  }
  /**
   * Returns the summary of the review.
   * @return The review summary.
   */
  public String getSummary() {
    return my_summary;
  }
  
}
